import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service  # 正确导入Service

# 初始化Service（路径用双反斜杠）
service = Service(executable_path="E:\\python\\python38\\chromedriver.exe")
driver = webdriver.Chrome(service=service)

driver.get("http://121.43.169.97:8848/pageA.html")
# 输入用户名和密码
driver.find_element(By.XPATH, "//p[@id='pa']/input[@type='text']").send_keys("admin")
driver.find_element(By.XPATH, "//p/input[@type='password']").send_keys("123456")

time.sleep(2)  # 等待2秒
driver.quit()  # 退出浏览器